﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OP20.ViewModels
{
    public class CycleTimeStatisticViewModel : BaseViewModel
    {
        public CycleTimeStatisticViewModel(IRegionManager regionManager) : base(regionManager)
        {
            //开启定时器任务
            DispatcherTimer dispatcherTimer = new DispatcherTimer();
            dispatcherTimer.Interval = TimeSpan.FromMilliseconds(500);
            dispatcherTimer.Tick += OnTick;
            dispatcherTimer.Start();
        }

        private void OnTick(object? sender, EventArgs e)
        {
            ST1CT = ST1Station_Global.stationPLCToPC.nCycleTime;
            ST2CT = ST2Station_Global.stationPLCToPC.nCycleTime;
            ST3CT = ST3Station_Global.stationPLCToPC.nCycleTime;
            ST4CT = ST4Station_Global.stationPLCToPC.nCycleTime;
            ST5CT = ST5Station_Global.stationPLCToPC.nCycleTime;
            ST6CT = ST6Station_Global.stationPLCToPC.nCycleTime;
            ST8CT = ST8Station_Global.stationPLCToPC.nCycleTime;
            ST10CT = ST10Station_Global.stationPLCToPC.nCycleTime;
            ST11CT = ST11Station_Global.stationPLCToPC.nCycleTime;
            ST12CT = ST12Station_Global.stationPLCToPC.nCycleTime;
            ST13CT = ST13Station_Global.stationPLCToPC.nCycleTime;
            ST14CT = ST14Station_Global.stationPLCToPC.nCycleTime;
            ST15CT = ST15Station_Global.stationPLCToPC.nCycleTime;
        }
        #region 属性

        private float _ST1CT;
        public float ST1CT
        {
            get { return _ST1CT; }
            set { SetProperty(ref _ST1CT, value); }
        }

        private float _ST2CT;
        public float ST2CT
        {
            get { return _ST2CT; }
            set { SetProperty(ref _ST2CT, value); }
        }

        private float _ST3CT;
        public float ST3CT
        {
            get { return _ST3CT; }
            set { SetProperty(ref _ST3CT, value); }
        }

        private float _ST4CT;
        public float ST4CT
        {
            get { return _ST4CT; }
            set { SetProperty(ref _ST4CT, value); }
        }

        private float _ST5CT;
        public float ST5CT
        {
            get { return _ST5CT; }
            set { SetProperty(ref _ST5CT, value); }
        }
        private float _ST6CT;
        public float ST6CT
        {
            get { return _ST6CT; }
            set { SetProperty(ref _ST6CT, value); }
        }

        private float _ST7CT;
        public float ST7CT
        {
            get { return _ST7CT; }
            set { SetProperty(ref _ST7CT, value); }
        }

        private float _ST8CT;
        public float ST8CT
        {
            get { return _ST8CT; }
            set { SetProperty(ref _ST8CT, value); }
        }

        private float _ST9CT;
        public float ST9CT
        {
            get { return _ST9CT; }
            set { SetProperty(ref _ST9CT, value); }
        }
        private float _ST10CT;
        public float ST10CT
        {
            get { return _ST10CT; }
            set { SetProperty(ref _ST10CT, value); }
        }
        private float _ST11CT;
        public float ST11CT
        {
            get { return _ST11CT; }
            set { SetProperty(ref _ST11CT, value); }
        }

        private float _ST12CT;
        public float ST12CT
        {
            get { return _ST12CT; }
            set { SetProperty(ref _ST12CT, value); }
        }

        private float _ST13CT;
        public float ST13CT
        {
            get { return _ST13CT; }
            set { SetProperty(ref _ST13CT, value); }
        }

        private float _ST14CT;
        public float ST14CT
        {
            get { return _ST14CT; }
            set { SetProperty(ref _ST14CT, value); }
        }

        private float _ST15CT;
        public float ST15CT
        {
            get { return _ST15CT; }
            set { SetProperty(ref _ST15CT, value); }
        }
        #endregion
    }
}
